package com.study.zzedu.fragment.tab;


import android.support.v4.app.Fragment;

import com.study.zzedu.fragment.home.mycourse.HomeFragment;
import com.study.zzedu.fragment.home.onlinevideo.OnlineVideoFragment;
import com.study.zzedu.fragment.home.qualityedu.QualityEduFragment;
import com.study.zzedu.fragment.tab.discuss.DiscussFragment;
import com.study.zzedu.fragment.tab.onlinetest.OnLineTestFragment;

/**
 * Created by kiros on 2020/9/5.
 */

public class BaseVideoTabFragment extends Fragment {
    private static final int TAB_ONE = 0;
    private static final int TAB_TWO = 1;
    private static final int TAB_THIRD = 2;
    private static final int TAB_FOUR = 3;

    public BaseVideoTabFragment() {
    }

    public static Fragment newInstance(int position) {
        Fragment baseTabFragment;
        switch (position) {
            case TAB_ONE:
                baseTabFragment = new HomeFragment();
                break;
            case TAB_TWO:
                baseTabFragment = new OnlineVideoFragment();
                break;
            case TAB_THIRD:
                baseTabFragment = new QualityEduFragment();
                break;
            default:
                baseTabFragment = new QualityEduFragment();
        }
        return baseTabFragment;
    }

    @Override
    public void onDetach() {
        super.onDetach();
        getActivity().onBackPressed();
    }
}
